﻿using System.Collections.ObjectModel;
using 带导航.Domain;

namespace 带导航.ViewModels
{
    public class MainViewModel : BindableBase
    {
        public ObservableCollection<MenuCategory> MenuCategories { get; set; }

        public MainViewModel()
        {
            var rootNode = new MenuCategory("编程内功", "PineTree");

            var childNode1 = new MenuCategory("算法", "Folder",
                    new 带导航.Domain.MenuCategory("位运算", "TextBox"),
                    new 带导航.Domain.MenuCategory("冒泡排序", "TextBox"),
                    new 带导航.Domain.MenuCategory("二叉树", "TextBox"));
            childNode1.Parent = rootNode;

            var childNode2 = new MenuCategory("设计模式", "Folder",
                    new 带导航.Domain.MenuCategory("单例", "TextBox"),
                    new 带导航.Domain.MenuCategory("观察者", "TextBox")
                );
            childNode2.Parent = rootNode;
            rootNode.MenuItems = new ObservableCollection<Domain.MenuCategory>()
            {
                childNode1,childNode2
            };

            MenuCategories = new ObservableCollection<MenuCategory>
            {
                rootNode
            };
        }
    }
}
